namespace GameSchool.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class TeacherIDNullableInAchievementClass : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("Achievements", "teacherID", "Teachers");
            DropIndex("Achievements", new[] { "teacherID" });
            AlterColumn("Achievements", "teacherID", c => c.Int());
            AddForeignKey("Achievements", "teacherID", "Teachers", "teacherID");
            CreateIndex("Achievements", "teacherID");
        }
        
        public override void Down()
        {
            DropIndex("Achievements", new[] { "teacherID" });
            DropForeignKey("Achievements", "teacherID", "Teachers");
            AlterColumn("Achievements", "teacherID", c => c.Int(nullable: false));
            CreateIndex("Achievements", "teacherID");
            AddForeignKey("Achievements", "teacherID", "Teachers", "teacherID", cascadeDelete: true);
        }
    }
}
